<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/7/28 0028
 * Time: 下午 3:51
 */

namespace app\admin\model;


use think\Model;

class ManagerGoods extends Model
{
    /**检测商品的MID
     * @param $id
     * @param $mid
     * @return bool
     * @throws \think\exception\DbException
     */
    public static function checkMid($id,$mid){
        $db = self::get($id)->toArray();
        if ($db['mid']!=$mid){
            return true;
        }else{
            return false;
        }
    }

    /**检测商品上架状态
     * @param $id
     * @return bool
     * @throws \think\exception\DbException
     */
    public static function checkStatus($id){
        $db = self::get($id)->toArray();
        if ($db['status']!=1){
            return true;
        }else{
            return false;
        }
    }
}